/**
 * 
 */
package events;

import controlPlane.PCE;
import wdmsim.Flow;
import wdmsim.Node;
import wdmsim.Simulator;

/**
 * @author Alisson
 *
 */
public class CrankbackEvent extends Event {

	private Flow flow;
	
	public CrankbackEvent(RouteRequestEvent event) {
		this.id = eventCounter++;
		this.generator = (PCE)event.getHandler();
		this.handler = (PCE)event.getGenerator();
		this.flow = event.getFlow();
	}

	public Flow getFlow() {
		return flow;
	}

	public void setFlow(Flow flow) {
		this.flow = flow;
	}

	public String toString() {
		return Simulator.CURRENT_TIME + " " + getId() + " " + getFlow().getId() + " " + ((Node) getHandler()).getId() + " " + getFlow().getSrc() + " " + getFlow().getDst();
	}
}
